<?php
/**
 * AdminModel
 *
 * @Description 描述
 * @Author look
 * @CreateTime 2022/2/21
 */

namespace app\common\model;

use app\common\base\ModelBase;

/**
 * Class AdminModel
 */
class AdminModel extends ModelBase {

    protected $table = "sys_admin";

    public function loadAdminByUsername(string $username): array {
        $admin = $this->where([
            'username' => $username
        ])->find();

        return $admin ? $admin->toArray() : [];
    }

}